package com.weixin.util;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import com.google.common.collect.Maps;
import com.weixin.vo.TXUserInfo;

public class CacheMap {
	public static Logger logger = Logger.getLogger(CacheMap.class);
	public static Map<String,TXUserInfo> map = Maps.newHashMap();
	
	public static void init(){
		List<String> list = FileUtil.readFile();
		if(list !=null && list.size()>0){
			
			for (String string : list) {
				TXUserInfo userObj =  (TXUserInfo)	GsonUtil.fromJson(string, TXUserInfo.class);
				map.put(userObj.getOpenid(), userObj);
			}
			
		}
		
		logger.debug("start up ...."+GsonUtil.toJson(map));
	}
}
